--[[

	Copyright (c) 2012-2020 baby-bus.com

	TODO:   Main
	Author: DemonYao
	Date:   2020.09.25
 
	http://www.babybus.com/ 

]] 




--------------------------
-- 引入命名空间
--------------------------
-- local BaseLayer = import("app.common.layer.BaseLayer")




--[[
	类
--]]


local M = classLayerTouch("Main")




--------------------------
-- 构造函数
--------------------------

function M:ctor(params)
	-- [超类调用]
	M.super.ctor(self, params)
	-- [本类调用]

end

--------------------------
-- 渲染
--------------------------

function M:onRender()
	-- [超类调用]
	M.super.onRender(self)

	-- [本类调用]
	-- 加载节点
	self:loadNodes()
end

-- 加载节点
function M:loadNodes()
	self.robot = self:createNode("Robot", {
		dragonBonesDataFile = "mecha_1004d/mecha_1004d_ske.json",
		dragonBonesTexFile  = "mecha_1004d/mecha_1004d_tex.json",
		armatureName        = "mecha_1004d",
		animName            = "walk",
		index = 1,
	}):p(480, 200):to(self)


	-- self.robot1 = self:createNode("Robot", {
	-- 	dragonBonesDataFile = "mecha_1004d/mecha_1004d_ske.json",
	-- 	dragonBonesTexFile  = "mecha_1004d/mecha_1004d_tex.json",
	-- 	armatureName        = "mecha_1004d",
	-- 	animName            = "skill_03",
	-- 	index = 2,
	-- }):p(880, 200):to(self) 

	-- self:line({
	-- 	{"delay", 5},
	-- 	{"fn", function()
	-- 		self.robot:remove()
	-- 	end},
	-- })
end

-- 加载渲染以外的其他操作 
function M:onEnterTransitionFinish()
	--
end




--------------------------
-- 触控
-------------------------- 

function M:onTouchBegan(x, y, touches)
	-- self.robot:fadeInplay("skill_03", 0.2)

	
	--  触控有效
	return true 
end

function M:onTouchMoved(x, y, touches)
	--   
end

function M:onTouchEnded(x, y, touches)
	--  
end



--------------------------
-- 功能函数
--------------------------




--------------------------
-- 属性
--------------------------




--------------------------
-- 父类重写
--------------------------




----------------------------------------------------
-- 析构
--------------------------

function M:onDestructor()
	-- [超类调用]
	M.super.onDestructor(self)
	-- [本类调用]

end








return M






